package edu.sctu.xialei.May.day20150510one;

/**
 * Created by Administrator on 2015/5/11 0011.
 */
public class DayAll {

    public static void main(String[] args) {

        DayAll outPrint = new DayAll();

        outPrint.printing(outPrint.setValue());


    }

    public ReturnValue setValue(){

        Day1 day1 = new Day1();

        day1.setInfo("隔壁老王","2015",18);

        Day1 day2 = new Day1();

        day2.setInfo("隔壁老夏","2014",15);

        Day1 []dayAll = {day1,day2};

        ReturnValue allData = new ReturnValue();

        allData.num = dayAll.length;
        allData.dayAll = dayAll;

        return allData;
    }

    public void printing(ReturnValue allData){

        for(int count = 0;count < allData.num;count++) {
            System.out.println("第" + (count+1) + "个人" );
            System.out.println(allData.dayAll[count].name + "在" + allData.dayAll[count].year + "是" + allData.dayAll[count].age + "岁");
        }
    }
}
